<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: install.php 8889 2010-04-23 07:48:22Z monkey $
 */

if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

$sql = <<<EOF

DROP TABLE IF EXISTS pre_er_sign_in_log;
CREATE TABLE pre_er_sign_in_log
(
    id         INT AUTO_INCREMENT
        PRIMARY KEY,
    uid        INT           NOT NULL,
    credit     INT DEFAULT 0 NOT NULL,
    continuous INT DEFAULT 0 NOT NULL,
    dateline   INT           NULL,
    INDEX idx_uid_continuous (uid, continuous),
    INDEX idx_uid_dateline (uid, dateline)
)
ENGINE = INNODB;

DROP TABLE IF EXISTS pre_er_sign_in_config;
CREATE TABLE pre_er_sign_in_config
(
    id    INT AUTO_INCREMENT
        PRIMARY KEY,
    `key` VARCHAR(50) NOT NULL,
    name  VARCHAR(50) NOT NULL,
    value TEXT        NULL,
    `desc` VARCHAR(255) NULL,
    UNIQUE KEY (`key`)
)
ENGINE = INNODB;

INSERT INTO pre_er_sign_in_config (`key`, name, value, `desc`) 
VALUES 
('extcredits', '积分类型', '2', '使用的积分类型'),
('credit', '签到金币积分区间', '["1","30"]', '签到时随机取值'),
('position', '电脑端显示位置', 'usernav_extra3', ''),
('mobile_position', '手机端显示位置', 'index_find_extra_mobile', ''),
('position_float_value', '浮动定位', '["92","35"]', '按页面百分比决定位置'),
('position_float_color', '浮动颜色', '#ffffff', '浮动文字颜色'),
('position_float_bgcolor', '浮动背景颜色', '#000000', '浮动背景颜色');


EOF;


runquery($sql);

$modules = array(
    'sign_in' => array(
        'name' => '每日签到',
        'mobile' => 1, 
        'adminid' => 0
    )
);

$finish = TRUE;

?>